package com.example.customview.waveview

import android.graphics.Paint
import androidx.interpolator.view.animation.LinearOutSlowInInterpolator
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseFragment
import com.example.customview.R
import com.example.customview.arouter.CustomArouter
import com.example.customview.databinding.FragmentWaveViewBinding

@Route(path = CustomArouter.CUSTOM_WAVE_VIEW)
class WaveViewFragment:BaseFragment<FragmentWaveViewBinding>() {
    override fun getLayoutID()= R.layout.fragment_wave_view

    override fun initView() {
        mBinding.waveView.setInitialRadius(130f)
        mBinding.waveView.setSpeed(1500)
        mBinding.waveView.setStyle(Paint.Style.FILL)
        mBinding.waveView.setColor(0x71C7AE)
        mBinding.waveView.setInterpolator(LinearOutSlowInInterpolator())
       mBinding.btnStart.setOnClickListener {
           mBinding.waveView.start()
       }
        mBinding.btnStop.setOnClickListener {
            mBinding.waveView.stop()
        }
    }
}